<?php
// +----------------------------------------------------------------------
// | @filename MenuModel.php
// +----------------------------------------------------------------------
// | @author 落花轻舞问君愁 <mwcx1990@qq.com>
// +----------------------------------------------------------------------
// | @datetime 2021-11-01 17:58:27
// +----------------------------------------------------------------------
// | @Description
// +----------------------------------------------------------------------

namespace Addons\Backend\Models;


use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Spatie\Permission\Models\Role;

class Menu extends BaseModel
{
    protected $guarded = [];

    public function roles(): BelongsToMany
    {
        return $this->belongsToMany(
            Role::class,
            MenuHasRole::class,
            'menu_id',
            'role_id'
        );
    }
}
